{% extends "base.html" %}
{% block content %}
<head>
    <title>First Record</title>
    {{ date_form.media }}
    {{ css_media.media }}
</head>
    <body>
    
    <h3>
        <p> Timesheet: {{ first_name }} {{ last_name }} </p>
    </h3>

    {% if is_financier %}
        <a class="link" href="{% url financier %}"> Page of the financier </a>
    {% endif %}

    {% if is_manager %}
        <a class="link" href="{% url manager %}"> Page of the manager </a>
    {% endif %}

    <br><br>
    
    <a class="link" href="{% url user_complete %}"> Completion of data </a>
    
    <div align=center>
        <h3> <p>You should enter the first record</p> </h3>
        <p> NOTE: Date should be written in format YYYY-MM-DD, otherwise record will not be created. </p>

        <form action="" method=post class="FormTimeCreate">
            Projects {{ projects_form.projects }}
            Activities {{ activity_form.activities }}
            Hours {{ time_form.time }}
            Details {{ time_form.details }}
            Date {{ date_form.date }}            
            <input type=submit value=Ok id="TimeForm" />
            
            {% if projects_form.errors %}
                <ul> Projects: {{ projects_form.projects.errors }} </ul>
            {% endif %}
            
            {% if activity_form.errors %}
                <ul> Activities: {{ activity_form.activities.errors }} </ul>
            {% endif %}
            
            {% if time_form.errors %}
                <ul> Hours: {{ time_form.time.errors }} </ul>
            {% endif %}

            {% if date_form.errors %}
                <ul> Date: {{ date_form.date.errors }} </ul>
            {% endif %}
            
        </form>
     <div class="link">
        <p><a id="logout" href="{% url auth_logout %}">Logout</a>.</p>
    </div>
   </div>        
    </body>
{% endblock %}